import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from applications.extensions import db

class Examination(db.Model):
    __tablename__ = 'admin_examination'
    id = db.Column(db.Integer, primary_key=True, comment='ID')
    title = db.Column(db.String(255), comment='标题')
    user_id = db.Column(db.String(255), comment='发布者id')
    username = db.Column(db.String(255), default=1, comment='发布者姓名')
    num = db.Column(db.Integer, default=0,comment='点击')
    commentnum = db.Column(db.Integer, default=0, comment='评论数量')
    content = db.Column(db.String(255), comment='内容')
    answers = db.Column(db.String(255), comment='正确答案')
    sort = db.Column(db.Integer,default=1, comment='排序')
    type = db.Column(db.Integer,default=1, comment='1:单选提2：多选题3：判断题')

    create_time = db.Column(db.DateTime, default="", comment='发布时间')
    update_time = db.Column(db.DateTime, default="", onupdate=datetime.datetime.now, comment='更新时间')


